/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package MainClasses.EventListeners;

import MainClasses.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JTextField;

/**
 *
 * @author andrewcutler
 */
public class SetupScreenListener implements ActionListener{

    
    public static String SET_ID = "setid";
    public static String SET_EMAIL = "setemail";
    private JTextField field;
    
    public SetupScreenListener(JTextField f)
    {
        field = f;
        
    }
    
    public SetupScreenListener()
    {
        
    }
    
    
    public void actionPerformed(ActionEvent event) {
        
        if(event.getActionCommand().equals(SetupScreenListener.SET_ID))
        {
            main.getPrefs().setID(Integer.parseInt(field.getText()));
            main.println(main.getPrefs().getID());
        }
        if(event.getActionCommand().equals(SetupScreenListener.SET_EMAIL))
        {
            main.getPrefs().setEmail(field.getText());
        }
        
        
    }

}
